<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.wenwu.common.utils.Status.AttachmentFrom"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>基本信息表单</title>
<script type="text/javascript" src="${path}/js/scripts/bootstart.js"></script>
<link rel="stylesheet" type="text/css" href="${path}/css/focus.css" />
</head>
<body>
	<!-- 附件上传 -->
	<script type="text/plain" id="myEditorFile"></script>
	<form id="basicForm" method="post">
		<div style="display: none;">
			<input name="basicId" class="mini-textbox" id="basicId" />
		</div>
		<div class="form_nav">
			<table width="100%" cellpadding="4" cellspacing="0">
				<tr>
					<td width="10%" class="xx_bt nonebor">代码类型:</td>
					<td width="24%" class="xx_type  nonebor"><input
						name="relicsCodeType" style="width: 90%;" class="mini-textbox"
						vtype="maxLength:100" /><span class="required_cls">*</span></td>
					<td width="10%" class="xx_bt nonebor">文物代码:</td>
					<td width="23%" class="xx_type  nonebor"><input name="userid"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td width="10%" class="xx_bt nonebor">曾用名:</td>
					<td width="23%" class="xx_type  nonebor"><input name="oldname"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">定名:</td>
					<td class="xx_type"><input name="name" style="width: 90%;"
						class="mini-textbox" vtype="maxLength:100" id="name" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">俗名:</td>
					<td class="xx_type"><input name="commonNames"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">年代类型:</td>
					<td class="xx_type"><input class="mini-combobox"
						showNullItem="true"
						url="${path}/mgr/dictionary/showListByKey?dicKey=1"
						nullItemText="请选择年代类型" name="yearType" style="width: 90%;"
						textField="dicValue" valueField="dicValue" allowInput="false" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">地质学年代:</td>
					<td class="xx_type"><input name="geologyYear"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">考古学年代:</td>
					<td class="xx_type"><input class="mini-combobox"
						showNullItem="true"
						url="${path}/mgr/dictionary/showListByKey?dicKey=2"
						nullItemText="请选择考古学年代" name="relicsYear" style="width: 90%;"
						textField="dicValue" valueField="dicValue" allowInput="false" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">中国历史年代:</td>
					<td class="xx_type"><input class="mini-combobox"
						showNullItem="true"
						url="${path}/mgr/dictionary/showListByKey?dicKey=3"
						nullItemText="请选择中国历史年代" name="historyYear" style="width: 90%;"
						textField="dicValue" valueField="dicValue" allowInput="false" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">精确年代:</td>
					<td class="xx_type"><input name="year" style="width: 90%;"
						class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">文物类别:</td>
					<td class="xx_type"><input class="mini-combobox"
						showNullItem="true"
						url="${path}/mgr/dictionary/showListByKey?dicKey=4"
						nullItemText="请选择文物类别" name="category" style="width: 90%;"
						textField="dicValue" valueField="dicValue" allowInput="false" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">文物级别:</td>
					<td class="xx_type"><input class="mini-combobox"
						showNullItem="true"
						url="${path}/mgr/dictionary/showListByKey?dicKey=5"
						nullItemText="请选择文物级别" name="singlerelicnumber"
						style="width: 90%;" textField="dicValue" valueField="dicValue"
						allowInput="false" /><span class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">分布面积:</td>
					<td class="xx_type"><input name="spreadArea"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">保护范围面积:</td>
					<td class="xx_type"><input name="protectarea"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">建筑占地面积:</td>
					<td class="xx_type"><input name="buildArea"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">建设控制地带:</td>
					<td class="xx_type"><input name="manageArea"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">公布时代:</td>
					<td class="xx_type"><input name="publishTime"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">公布批次:</td>
					<td class="xx_type"><input name="publishBatch"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">公布编号:</td>
					<td class="xx_type"><input name="publishNumber"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">公布地址:</td>
					<td class="xx_type"><input name="publishAddress"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">现地址:</td>
					<td class="xx_type"><input name="address" style="width: 90%;"
						class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">经度:</td>
					<td class="xx_type"><input name="longitude"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">纬度:</td>
					<td class="xx_type"><input name="latitude" style="width: 90%;"
						class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">海拔高度:</td>
					<td class="xx_type"><input name="altitude" style="width: 90%;"
						class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">测点说明:</td>
					<td class="xx_type"><input name="pointdescription"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">使用者:</td>
					<td class="xx_type"><input name="basicUser"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">管理机构:</td>
					<td class="xx_type"><input name="manageOrganId"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">公布机关:</td>
					<td class="xx_type"><input name="publishOrgan"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">公布日期:</td>
					<td class="xx_type"><input class="mini-datepicker"
						style="width: 90%;" allowInput="false" name="publishDate"
						format="yyyy-MM-dd" /><span class="required_cls">*</span></td>
					<td class="xx_bt">所有权:</td>
					<td class="xx_type"><input class="mini-combobox"
						showNullItem="true"
						url="${path}/mgr/dictionary/showListByKey?dicKey=6"
						nullItemText="请选择所有权" name="ownership" style="width: 90%;"
						textField="dicValue" valueField="dicValue" allowInput="false" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">原设计功能:</td>
					<td class="xx_type" colspan="5"><input name="designFunction"
						style="width: 97%;" class="mini-textarea" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">实际使用功能:</td>
					<td class="xx_type" colspan="5"><input name="purpose"
						style="width: 97%;" class="mini-textarea" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">建设情况:</td>
					<td class="xx_type" colspan="5"><input name="buildSituation"
						style="width: 97%;" class="mini-textarea" /><span
						class="required_cls">*</span></td>
				</tr>
				<tr>
					<td class="xx_bt">声像影片:</td>
					<td class="xx_type" colspan="3"><input name="audioId"
						style="width: 95%;" class="mini-textarea" /><span
						class="required_cls">*</span></td>
					<td class="xx_bt">
						<!-- 附件上传开始 --> <a class="mini-button" iconCls="icon-upload"
						onclick="upFiles('<%=AttachmentFrom.RELICS_BASIC_01%>','showfiles')">浏览文件</a>
						<!-- 附件上传结束-->
					</td>
					<td class="xx_type" id="showfiles"><c:if
							test="${param.flag=='edit'}">
							<c:if test="${!empty attachments}">
								<c:forEach var="att" items="${attachments}">
									<input type="hidden" value="${att.attachmentPath}"
										name="filePath">
									<input type="hidden" value="${att.attachmentName}"
										name="fileName">
									<input type="hidden" value="${att.attachmentOwner}"
										name="attachmentOwner">
									<a target="_blank" href="${att.attachmentPath}" class="views">${att.attachmentName}</a>
									<br />
								</c:forEach>
							</c:if>
						</c:if></td>
				</tr>
				<tr>
					<td class="xx_bt">备注:</td>
					<td class="xx_type" colspan="5"><input name="common"
						style="width: 97%;" class="mini-textarea" /><span
						class="required_cls">*</span></td>
				</tr>
				<c:if test="${param.flag=='edit'}">
					<tr>
						<td class="xx_bt">其它信息:</td>
						<td class="xx_type" colspan="5" align="center"><a
							class="mini-button" onclick="addform.umprotectsatuform">保存现状</a>
							<a class="mini-button" onclick="addform.cultural">文化面貌</a> <a
							class="mini-button" onclick="addform.umprotectAreaform">保护区划及情况</a>
							<a class="mini-button" onclick="addform.natural">自然环境</a> <a
							class="mini-button" onclick="addform.humanity">人文环境</a> <a
							class="mini-button" onclick="addform.umaudio">声像影片</a> <a
							class="mini-button" onclick="addform.mapping">测绘图纸</a></td>
					</tr>
				</c:if>
			</table>
		</div>
		<div style="text-align: center; padding: 10px;">
			<a class="mini-button" onclick="addform.saveData" id="sub_button"
				iconCls="icon-save" style="width: 60px; margin-right: 20px;">保存</a>
			<a iconCls="icon-cancel" class="mini-button"
				onclick="$.form.onCancel()" style="width: 60px;">取消</a>
		</div>
	</form>
</body>
<script type="text/javascript" src="${path}/js/scripts/dataform.js"></script>
<script type="text/javascript" charset="utf-8"
	src="${path}/js/scripts/swfupload/swfupload.js"></script>
<script type="text/javascript"
	src="${path}/js/scripts/plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript"
	src="${path}/js/scripts/plugin/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="${path}/js/upload.js"></script>
<script type="text/javascript" src="${path}/js/message.js"></script>
<script type="text/javascript">
	var doc = $(document);
	$(function() {
		$.form.init(); //初始化表单
		window.addform = {};
		addform.saveData = function() {
			var form = new mini.Form("#basicForm");
			form.validate();
			if (form.isValid() == false) {
				return;
			}
			$.form.saveData({
				url : "${path}/mgr/umbasic/addBasic",
				showMsg : true,//是否显示提示信息（返回参数必须是msg，json类型数据）
				id : "basicForm"
			});
		};
		addform.humanity = function() {//人文环境
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form.edit({
				url : "${path}/mgr/humanity/humanityform?flag=edit&basicId="
						+ mini.get("basicId").value + "&name=" + name,
				title : "人文环境",
				formId : "humanityForm",
				fieldId : "basicId",
				fieldIdValue : mini.get("basicId").value,
				width : doc.width() * 0.9 + "px",
				height : doc.height() * 0.7 + "px",
				dataUrl : "${path}/mgr/humanity/showUpdate"
			});
		};
		addform.mapping = function() {//测绘图纸
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form.edit({
				url : "${path}/mgr/mapping/mappingform?flag=edit&basicId="
						+ mini.get("basicId").value + "&name=" + name,
				title : "测绘图纸",
				formId : "mappingForm",
				fieldId : "basicId",
				fieldIdValue : mini.get("basicId").value,
				width : doc.width() * 0.8 + "px",
				height : doc.height() * 0.6 + "px",
				dataUrl : "${path}/mgr/mapping/showUpdate"
			});
		};
		//声像影片
		addform.umaudio = function() {
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form.edit({
				url : "${path}/mgr/umaudio/umaudioform?flag=edit&relicsId="
						+ mini.get("basicId").value + "&name=" + name,
				title : "声像影片",
				formId : "umaudioForm",
				fieldId : "basicId",
				fieldIdValue : mini.get("basicId").value,
				width : doc.width() * 0.8 + "px",
				height : doc.height() * 0.6 + "px",
				dataUrl : "${path}/mgr/umaudio/showUpdate"
			});
		};
		//保存现状
		addform.umprotectsatuform = function() {
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form
					.edit({
						url : "${path}/mgr/umprotectsatu/umprotectsatuform?flag=edit&basicId="
								+ mini.get("basicId").value + "&name=" + name,
						title : "保存现状",
						formId : "umprotectSatuForm",
						fieldId : "basicId",
						fieldIdValue : mini.get("basicId").value,
						width : doc.width() * 0.8 + "px",
						height : doc.height() * 0.6 + "px",
						dataUrl : "${path}/mgr/umprotectsatu/showUpdate"
					});
		};
		//保护区划及保护情况
		addform.umprotectAreaform = function() {
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form
					.add({
						url : "${path}/mgr/protectArea/umprotectAreaForm?flag=edit&basicId="
								+ mini.get("basicId").value + "&name=" + name,
						title : "保护区划及保护情况",
						max : true,
						width : doc.width() * 1 + "px",
						height : doc.height() * 1 + "px"
					});
		};
		//自然环境
		addform.natural = function() {
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form.edit({
				url : "${path}/mgr/natural/naturalform?flag=edit&basicId="
						+ mini.get("basicId").value + "&name=" + name,
				title : "自然环境",
				formId : "naturalForm",
				fieldId : "basicId",
				fieldIdValue : mini.get("basicId").value,
				width : doc.width() * 0.8 + "px",
				height : doc.height() * 0.7 + "px",
				dataUrl : "${path}/mgr/natural/showUpdate"
			});
		};
		//文化面貌
		addform.cultural = function() {
			var name = encodeURI(encodeURI(mini.get("name").value));
			$.form.edit({
				url : "${path}/mgr/cultural/culturalform?flag=edit&basicId="
						+ mini.get("basicId").value + "&name=" + name,
				title : "文化面貌",
				formId : "culturalForm",
				fieldId : "basicId",
				fieldIdValue : mini.get("basicId").value,
				width : doc.width() * 0.8 + "px",
				height : doc.height() * 0.6 + "px",
				dataUrl : "${path}/mgr/cultural/showUpdate"
			});
		};
	});
</script>
</html>